package Data::Conveyor::Ticket::Payload::Common;

# $Id: Common.pm 13653 2007-10-22 09:11:20Z gr $

use warnings;
use strict;


our $VERSION = '0.02';


use base 'Data::Conveyor::Ticket::Payload::Item';


__PACKAGE__
    ->mk_scalar_accessors(qw(log_level))
    ->mk_framework_object_accessors(
        value_ticket_rc     => 'default_rc',
        value_ticket_status => 'default_status',
    );


sub DEFAULTS {
    (
        default_rc     => $_[0]->delegate->RC_OK,
        default_status => $_[0]->delegate->TS_RUNNING,
    )
}


sub check {}


# A stage can set the default rc (barring any exceptions) in the common
# payload item's; it will be applied in rc(). Ditto for status().

sub rc {
    my ($self, $ticket) = @_;
    my $rc = $self->SUPER::rc($ticket);
    $rc += $self->default_rc if defined $self->default_rc;
}


sub status {
    my ($self, $ticket) = @_;
    my $status = $self->SUPER::status($ticket);
    $status += $self->default_status if defined $self->default_status;
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - stage-based conveyor-belt-like ticket handling system

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

